<include file="public@header">
<body style="width: 100%">
    <!-- <div class="slide" id="div1" data-price="333">
        <p>下单价格：33333</p>
        <p>下单金额：333UDAT</p>
        <p>实时盈亏：盈</p>
        <p>倒计时： <span>13s</span></p>
    </div>
    <div class="slide" id="div2" data-price="333">
        <p>下单价格：333333</p>
        <p>下单金额：333UDAT</p>
        <p>实时盈亏：盈</p>
        <p>倒计时： <span>13s</span></p>
    </div> -->
    <div class="indexbg bgfff padbto22 headhead" style="background: #1f1e24;padding-left: 0;padding-right: 0; ">
        <div class="zqhead">
            <p onclick="showalert(this)" data-type="zq_choosebz"><img src="__STATIC__/hybit/images/open.png" alt="">{$row.name}/USDT</p>
            <a href="{:url('user/share/index')}"><img src="__STATIC__/hybit/images/share.png" alt=""></a>
        </div>
        <div class="zqinf">
            <div class="zqinfleft">
                <h3 class="{$row.name}_price"></h3>
                <p><span class="{$row.name}_price_rmb"></span><span class="{$row.name}_zf"></span></p>
            </div>
            <div class="zqinfright">
                <p>{:lang('High')}<span class="{$row.name}_h"></span></p>
                <p>{:lang('Low')}<span class="{$row.name}_l"></span></p>
                <p>24H<span class="{$row.name}_v"></span></p>
            </div>
        </div>
        <div class="zqnav" id="divperiod">
            <span class="span" v="T" lt="line">{:lang('Line')}</span>
            <span class="span active" v="1min">1{:lang('min')}</span>
            <span class="span" v="5min">5{:lang('min')}</span>
            <span class="span" v="15min">15{:lang('min')}</span>
            <span class="span" v="30min">30{:lang('min')}</span>
            <span class="span" v="60min">1{:lang('h')}</span>
            <span class="span" v="4hour">4{:lang('h')}</span>
            <span class="span" v="1day">{:lang('d')}</span>
        </div>
        <div class="zq-k" id="container">
        </div>
       <div class="indexlist">
            <div class="indexlisthead">
                <div class="active" data-type="zqlist01"><p>{:lang('Profit order')}</p></div>
                <div data-type="zqlist02"><p>{:lang('Position order')}</p></div>
                <div data-type="zqlist03"><p>{:lang('Transaction order')}</p></div>
            </div>
            <div class="zqlist zqlist1 zqlist01">
                <div class="zqlisthead1">
                    <p>{:lang('Complete time')}</p>
                    <p>{:lang('Direction')}</p>
                    <p>{:lang('Profit')}</p>
                    <p>{:lang('Opening price')}</p>
                    <p>{:lang('Closing price')}</p>
                </div>
                <foreach name="yl_order_list" item="vo">
                <div>
                    <p>{:date('H:i:s',$vo.closing_time)}</p>
                    <p class="<if $vo.direction == 1>zqup<else/>zqdown</if>">{:lang(lang('direction_text')[$vo.direction])}</p>
                    <p>{:floatval($vo.shouyi)}USDT</p>
                    <p>{:floatval($vo.opening_price)}</p>
                    <p>{:floatval($vo.closing_price)}</p>
                </div>
                </foreach>
            </div>
            <div class="zqlist3 zqlist2 zqlist02">
                <!-- <div class="zqlisthead1">
                    <p>开仓时间</p>
                    <p>方向</p>
                    <p>交易量</p>
                    <p>开仓价</p>
                    <p>周期</p>
                </div> -->
                <i id="html_1">
                <foreach name="cc_order" item="vo">
                <!-- <div>
                    <p>{:date('H:i:s',$vo.order_time)}</p>
                    <p class="zqdown">{:lang('direction_text')[$vo.direction]}</p>
                    <p>{:floatval($vo.order_amount)}USDT</p>
                    <p>{:floatval($vo.opening_price)}</p>
                    <p>{$vo.cycle}</p>
                </div> -->
                <div class="cj_show">
                    <div class="cj_showhead">
                        <p>{:lang('Rate of return')}：{$vo.yield}%<span>{:date('Y-m-d H:i:s',$vo.order_time)}</span></p>
                        <h3>{:lang(lang('direction_text')[$vo.direction])}<span>{$vo.symbol}/USDT</span><!-- <img src="__STATIC__/hybit/images/share2.png" alt=""> --></h3>
                    </div>
                    <div class="cj_shownote">
                        <div class="cj_shownote1">
                            <div class="cj_shownote2">
                                <div>
                                    <p>{:lang('Coin')}</p>
                                    <p>USDT</p>
                                </div>
                                <div>
                                    <p>{:lang('Opening price')}</p>
                                    <p>{:floatval($vo.opening_price)}</p>
                                </div>
                                <div>
                                    <p>{:lang('Total transaction')}</p>
                                    <p>{:floatval($vo.order_amount)}</p>
                                </div>
                            </div>
                            <div class="cj_shownote2">
                                <div>
                                   <p>{:lang('Cycle')}</p>
                                   <p>{:$vo.cycle}S</p>
                                </div>
                                <div>
                                   <p>{:lang('Countdown')}</p>
                                   <p class="djs">{:$vo.plan_time-time()}</p>
                                </div>
                                <div>
                                   <p>{:lang('Expected return')}</p>
                                   <p>{:floatval($vo.order_amount*$vo.yield/100)}</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                </foreach>
                </i>
            </div>
            <div class="zqlist3 zqlist03" id="html_2">
                <foreach name="finish_order" item="vo">
                <div class="cj_show">
                    <div class="cj_showhead">
                        <p>{:lang('Rate of return')}：{$vo.yield}%<span>{:date('Y-m-d H:i:s',$vo.closing_time)}</span></p>
                        <h3>{:lang(lang('direction_text')[$vo.direction])}<span>{$vo.symbol}/USDT</span><!-- <img src="__STATIC__/hybit/images/share2.png" alt=""> --></h3>
                    </div>
                    <div class="cj_shownote">
                        <div class="cj_shownote1">
                            <div class="cj_shownote2">
                                <div>
                                    <p>{:lang('Coin')}</p>
                                    <p>USDT</p>
                                </div>
                                <div>
                                    <p>{:lang('Opening price')}</p>
                                    <p>{:floatval($vo.opening_price)}</p>
                                </div>
                                <div>
                                    <p>{:lang('Total transaction')}</p>
                                    <p>{:floatval($vo.order_amount)}</p>
                                </div>
                            </div>
                            <div class="cj_shownote2">
                                <div>
                                   <p>{:lang('Cycle')}</p>
                                   <p>{:$vo.cycle}S</p>
                                </div>
                                <div>
                                   <p>{:lang('Closing price')}</p>
                                   <p>{:floatval($vo.closing_price)}</p>
                                </div>
                                <div>
                                    <if $vo.result == 1><p>{:lang('Profit')}</p><else/><p>{:lang('Loss')}</p></if>
                                    <p>{:floatval($vo.shouyi)}</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                </foreach>
            </div>
        </div>
       
        <div class="pop">
            <div class="pop_md" onclick="hidealert()"></div>
            <div class="zq_choosebz">
                <h3>{:lang('Cycle contract')} <img src="__STATIC__/hybit/images/open.png" alt=""></h3>
                <div class="zq_choosebzscroll">
                    <foreach name="symbol_list" item="vo">
                        <a href="{:url('user/cycle/index')}?symbol={$vo.name}">
                        <div class="zq_choosebzshow">
                            <h3>{$vo.name}<span>/USDT</span><span class="{$vo.name}_price">{:floatval($vo.price)}</span></h3>
                            <p>24H<span class="{$vo.name}_v">{$vo.v}</span></p>
                        </div>
                        </a>
                    </foreach>
                </div>
            </div>
            <div class="zq_buyup zq_buyupup">
                <div class="zq_buyuphead">
                    <p>{$row.name}/USDT</p>
                    <p class="{$row.name}_price"></p>
                    <p onclick="hidealert()">{:lang('Cancel')}</p>
                </div>
                <div class="zq_buyupnote">
                    <p id="timeDiv">{:date('Y-m-d H:i:s')}</p>
                    <div class="zq_buyupdiv">
                        <p>{:lang('Available')}</p>
                        <div class="zq_buyupdiv1">
                            <div class="zq_buyupdiv_a">
                                <input type="text" value="{$user.balance|default='0'}" name="balance" readonly>
                            </div>
                        </div>
                    </div>
                    <div class="zq_buyupdiv">
                        <p>{:lang('Amount')}</p>
                        <div class="zq_buyupdiv1">
                            <div class="zq_buyupdiv_a">
                                <input type="text" name="order_amount" placeholder="{$order.amount_min|default='50'} - {$order.amount_max|default='10000'}">
                            </div>
                        </div>
                    </div>
                    <div class="zq_buyupdiv">
                        <h3>{:lang('Cycle')}</h3>
                        <div class="zq_buyupdiv1">
                            <div data-cycle="60" class="zq_buyupdiv_c zq_active">
                                60s
                            </div>
                            <div data-cycle="120" class="zq_buyupdiv_c">
                                120s
                            </div>
                            <div data-cycle="300" class="zq_buyupdiv_c">
                                300s
                            </div>
                        </div>
                    </div>
                    <p class="zq_buyupnotep">{:lang('Expected rate of return')}：<i id="yield">{:get_yield()}</i>%<span>{:lang('Expected return')}:<i id="yj">0</i></span></p>
                    <button class="zq_buyupbtn">{:lang('Buy Up')}</button>
                </div>
            </div>
        </div>
       
        <div class="zqbtnall">
            <button class="btn_buyzhang" data-type="zq_buyupup" data-index="1" onclick="showalert(this)">{:lang('Buy Up')}</button>
            <button class="btn_buydie" data-type="zq_buyupup" data-index="2"  onclick="showalert(this)">{:lang('Buy Down')}</button>
        </div>
       
        <include file="public@navbar">



    </div>
    <script src="__STATIC__/hybit/js/jquery.min.js"></script>
    <script src="__STATIC__/hybit/js/swiper.min.js"></script>
    <script src="__STATIC__/hybit/js/Tdrag.min.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script type="text/javascript" src="__STATIC__/cycle/js/echarts/echarts.min.js"></script>
    <if cookie('think_var') == 'en-us'>
        <script type="text/javascript" src="__STATIC__/cycle/js/normalecharts/echartsfunc.js?v=090308"></script>
    <else/>
        <script type="text/javascript" src="__STATIC__/cycle/js/normalecharts/echartsfunc_cn.js?v=090308"></script>
    </if>
    <script type="text/javascript" src="__STATIC__/cycle/js/normalecharts/echartsdata.js?v=090308"></script>
    <script type="text/javascript">
        var ismobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
        //设置颜色，_set0为黑色，_setf为白色
        var _sets = _set0;

        var _dom = document.getElementById("container");
        _dom.style.height = (_sets.frametop + _sets.h + _sets.h2 + 30) + "px";
        var _myChart = echarts.init(_dom);


        //品种代码 按接口提供参数,自行填写默认值
        var __symbol = "{$symbol}";
        //周期 1M,5M,15M,30M,1H,4H,D,W,M 按接口提供参数
        var __period = "1min";
        //本地web接口
        var __quoteapi = "kms";

        var _num = 1000;
        //初始化柱数
        var _stnum = (ismobile ? 20 : 80);
        var _dzst = 30;
        var _dzed = 100;
        var _mtype = "candlestick";
        //查询频率毫秒
        var _interval = 1000;
    </script>
    <script type="text/javascript">
        var _dates = [];
        var _data = [];
        var _datal = [];
        var _volumes = [];

        var _timer1 = null;
        $(function () {
            //从get获取symbol参数
            var symbol = _getreq("symbol");
            if (symbol != undefined && symbol != "") {
                __symbol = symbol;
            }
            //从get获取period参数
            var period = _getreq("p");
            if (period != undefined && period != "") {
                __period = period;
            }

            if (__period == "1M")
                _mtype = "line";

            //其他功能
            $("#divperiod>span").click(function (e) {
                $(this).addClass("active");
                $(this).siblings().removeClass("active");
                changeperiod($(this).attr("v"), $(this).attr("lt"));
            });

            request();
            _timer1 = setInterval("timerDo()", _interval);
        });

        //设置颜色，_set0为黑色，_setf为白色
        function changeSet(t) {
            if (t == 0) { _sets = _set0; }
            else { _sets = _setf; }

            request();
        }

        function changeperiod(p, lt)
        {
            _dates = [];
            _data = [];
            _datal = [];
            _volumes = [];
            _lstkticks = 0;
            __period = p;

            if (__period == "T")
                _mtype = (lt == undefined ? "candlestick" : lt);
            else _mtype = "candlestick";

            request();
        }

        var _doingflag = false;
        function timerDo() {
            try {
                if (!_doingflag) {
                    _doingflag = true;
                    request();
                }
            }
            catch (e) { }
            _doingflag = false;
        }

        var _lstkticks = 0;

        //将报价数据同步到图表（比如列表里该品种的报价，要同步到图表价格，就调用这里）
        //注意：传入的k数据要和当前图表*周期*一致，如当前图表为5M,就不能传入日周期的开高低收报价
        //data是数组，结构如 [{Tick:当前k线的周期时间戳,O:100,H:100,L:100,C:100,V:100}] 
        function syncchart(sym, data) {
            console.log(1)
            if (sym == __symbol) {
                fixdata(data);
                render();
            }
        }
    </script>
    <script>
        var cycle = 60;
        var direction = 1;
        var symbol = '{$symbol}';

        $('.zqnav a').click(function(){
            $(this).siblings().removeClass('active');
            $(this).addClass('active');
        })
        
        $('.indexlisthead div').click(function(){
            let $this = $(this);
            $this.siblings().removeClass('active');
            $this.addClass('active');
            $this.parent().siblings().hide();
            let type = $this.attr('data-type');
            $('.' + type).show();
        })
        
        
        function hidealert(){
            $('.pop').fadeOut(100);
            $('.pop').children().fadeOut(100);
        }
        
        function showalert(obj){
            let $this = $(obj);
            let type = $this.attr('data-type');
            let index = $this.attr('data-index');
            $('.pop').fadeIn(100);
            $('.pop_md').show();
            $('.'+ type).show();
            direction = index;
            if(index){
                $.ajax({
                    type: 'get',
                    url: '{:url("cycle/get_new_config")}',
                    success:function(res){
                        if(res.code == 1){
                            $('#yield').html(res.data.yield);
                            $('input[name=order_amount]').attr('placeholder',res.data.amount_min+' - '+res.data.amount_max);
                        }
                    }
                });
            }
            if(index == 1){
                $('.zq_buyupbtn').removeClass('zq_buyupbtnactive');
                $('.zq_buyupbtn').html('{:lang("Buy Up")}');
            }else{
                $('.zq_buyupbtn').addClass('zq_buyupbtnactive');
                $('.zq_buyupbtn').html('{:lang("Buy Down")}');
            }
            $('.zq_buyupbtn').removeAttr('disabled');
        }
        
        $('.zq_buyupdiv1 .zq_buyupdiv_c').click(function(){
            $(this).siblings().removeClass('zq_active');
            $(this).addClass('zq_active');
            cycle = $(this).data('cycle');
        });

        layui.use('layer',function(){
            $('.zq_buyupbtn').click(function(){
                $('.zq_buyupbtn').attr('disabled',true);
                //需要输入资金密码，如果输入过一次则半小时之内不需要再次输入
                $.ajax({
                    type: 'get',
                    url: '{:url("user/zichan/verification")}',
                    success:function(res){
                        if(res.code == 1){
                            //输入资金密码
                            if(res.data == 1){
                                xiadan();
                            }else{
                                layer.prompt({title:'{:lang("Please enter the fund password")}'},function(value, index, elem){
                                    layer.close(index);
                                    $.ajax({
                                        type: 'post',
                                        url: '{:url("user/zichan/verification_password")}',
                                        data: {password:value},
                                        success:function(result){
                                            if(result.code == 1){
                                                xiadan();
                                            }else{
                                                layer.msg(result.msg);
                                                $('.zq_buyupbtn').removeAttr('disabled');
                                            }
                                        }
                                    });
                                });
                            }
                        }else{
                            layer.msg(res.msg);
                            $('.zq_buyupbtn').removeAttr('disabled');
                        }
                    }
                });
            });

            function xiadan()
            {
                var order_amount = $('input[name=order_amount]').val();
                $.ajax({
                    type: 'post',
                    url: '{:url("user/cycle/index")}',
                    data: {symbol:symbol,cycle:cycle,direction:direction,order_amount:order_amount},
                    success:function(res){
                        layer.msg(res.msg)
                        //console.log(res)
                        if(res.code == 1){
                            $('input[name=order_amount]').val('');
                            hidealert();
                            //余额更新
                            $.ajax({
                                type: 'get',
                                url: '{:url("user/zichan/balance")}',
                                success:function(result){
                                    $('input[name=balance]').val(result.data.balance);
                                }
                            });
                            //周期下单刷新
                            get_order_list();
                            //setTimeout('get_order_list()',1000*cycle+1000);
                        }
                        $('.zq_buyupbtn').removeAttr('disabled');
                    }
                });
            }

        });

        function get_order_list()
        {
            $.ajax({
                type: 'get',
                url: '{:url("user/order/get_order_list")}',
                data: {symbol:symbol},
                success:function(res){
                    //console.log(res);
                    var html_1 = '';
                    var html_2 = '';
                    var html_3 = '';
                    var json = res.data;
                    $('.slide').each(function(){
                        $(this).remove()
                    })
                    for(var key in json){
                        if(json[key]['status'] == 1){
                            // html_1 +='<div>';
                            // html_1 +='<p>'+json[key]['order_time']+'</p>';
                            // html_1 +='<p class="zqdown">'+json[key]['direction']+'</p>';
                            // html_1 +='<p>'+json[key]['order_amount']+'USDT</p>';
                            // html_1 +='<p>'+json[key]['opening_price']+'</p>';
                            // html_1 +='<p>'+json[key]['cycle']+'</p>';
                            // html_1 +='</div>';
                            html_1 +='<div class="cj_show">';
                            html_1 +='<div class="cj_showhead">';
                            html_1 +='<p>{:lang("Rate of return")}：'+json[key]['yield']+'%<span>'+json[key]['order_time']+'</span></p>';
                            if(json[key]['direction_val'] == 1){
                                html_1 +='<h3 class="zqup">'+json[key]['direction']+'<span>'+json[key]['symbol']+'/USDT</span><!-- <img src="__STATIC__/hybit/images/share2.png" alt=""> --></h3>';
                            }else{
                                html_1 +='<h3 class="zqdown">'+json[key]['direction']+'<span>'+json[key]['symbol']+'/USDT</span><!-- <img src="__STATIC__/hybit/images/share2.png" alt=""> --></h3>';
                            }
                            html_1 +='</div>';
                            html_1 +='<div class="cj_shownote">';
                            html_1 +='<div class="cj_shownote1">';
                            html_1 +='<div class="cj_shownote2">';
                            html_1 +='<div>';
                            html_1 +='<p>{:lang("Coin")}</p>';
                            html_1 +='<p>USDT</p>';
                            html_1 +='</div>';
                            html_1 +='<div>';
                            html_1 +='<p>{:lang("Opening price")}</p>';
                            html_1 +='<p>'+json[key]['opening_price']+'</p>';
                            html_1 +='</div>';
                            html_1 +='<div>';
                            html_1 +='<p>{:lang("Total transaction")}</p>';
                            html_1 +='<p>'+json[key]['order_amount']+'</p>';
                            html_1 +='</div>';
                            html_1 +='</div>';
                            html_1 +='<div class="cj_shownote2">';
                            html_1 +='<div>';
                            html_1 +='<p>{:lang("Cycle")}</p>';
                            html_1 +='<p>'+json[key]['cycle']+'S</p>';
                            html_1 +='</div>';
                            html_1 +='<div>';
                            html_1 +='<p>{:lang("Countdown")}</p>';
                            html_1 +='<p class="djs">'+json[key]['djs']+'</p>';
                            html_1 +='</div>';
                            html_1 +='<div>';
                            html_1 +='<p>{:lang("Expected return")}</p>';
                            html_1 +='<p>'+(json[key]['order_amount']*json[key]['yield']/100).toFixed(2)+'</p>';
                            html_1 +='</div>';
                            html_1 +='</div>';
                            html_1 +='</div>';
                            html_1 +='</div>';
                            html_1 +='</div>';

                            
                            
                            if(key < 7){
                                console.log(1);
                                html_3 +='<div class="slide slide'+key+'" id="alert'+json[key]['id']+'" data-price='+json[key]['opening_price']+' data-direction="'+json[key]['direction_val']+'">'
                                html_3 +='<p>{:lang("Opening price")}：'+json[key]['opening_price']+'</p>';
                                html_3 +='<p>{:lang("Amount")}：'+json[key]['order_amount']+'USDT</p>';
                                html_3 +='<p>{:lang("Real-time")}：<span class="slidetype">{:lang("Profit")}</span></p>';
                                html_3 +='<p>{:lang("Countdown")}： <span class="slidetime">'+json[key]['djs']+'s</span></p>';
                                html_3 +='</div>';
                                $('body').append(html_3)
                                // $('#alert'+json[key]['id']).Tdrag();
                                //console.log('#alert'+json[key]['id'])
                                html_3="";
                            }
                            setTimeout('get_order_list()',1000*json[key]['djs']+1000);
                            
                        }else{
                            html_2 +='<div class="cj_show">';
                            html_2 +='<div class="cj_showhead">';
                            html_2 +='<p>{:lang("Rate of return")}：'+json[key]['yield']+'%<span>'+json[key]['closing_time']+'</span></p>';
                            if(json[key]['direction_val'] == 1){
                                html_2 +='<h3 class="zqup">'+json[key]['direction']+'<span>'+json[key]['symbol']+'/USDT</span><!-- <img src="__STATIC__/hybit/images/share2.png" alt=""> --></h3>';
                            }else{
                                html_2 +='<h3 class="zqdown">'+json[key]['direction']+'<span>'+json[key]['symbol']+'/USDT</span><!-- <img src="__STATIC__/hybit/images/share2.png" alt=""> --></h3>';
                            }
                            html_2 +='</div>';
                            html_2 +='<div class="cj_shownote">';
                            html_2 +='<div class="cj_shownote1">';
                            html_2 +='<div class="cj_shownote2">';
                            html_2 +='<div>';
                            html_2 +='<p>{:lang("Coin")}</p>';
                            html_2 +='<p>USDT</p>';
                            html_2 +='</div>';
                            html_2 +='<div>';
                            html_2 +='<p>{:lang("Opening price")}</p>';
                            html_2 +='<p>'+json[key]['opening_price']+'</p>';
                            html_2 +='</div>';
                            html_2 +='<div>';
                            html_2 +='<p>{:lang("Total transaction")}</p>';
                            html_2 +='<p>'+json[key]['order_amount']+'</p>';
                            html_2 +='</div>';
                            html_2 +='</div>';
                            html_2 +='<div class="cj_shownote2">';
                            html_2 +='<div>';
                            html_2 +='<p>{:lang("Cycle")}</p>';
                            html_2 +='<p>'+json[key]['cycle']+'S</p>';
                            html_2 +='</div>';
                            html_2 +='<div>';
                            html_2 +='<p>{:lang("Closing price")}</p>';
                            html_2 +='<p>'+json[key]['closing_price']+'</p>';
                            html_2 +='</div>';
                            html_2 +='<div>';
                            if (json[key]['result'] == 1) {
                                html_2 +='<p>{:lang("Profit")}</p>';
                            }else{
                                html_2 +='<p>{:lang("Loss")}</p>';
                            }
                            html_2 +='<p>'+json[key]['shouyi']+'</p>';
                            html_2 +='</div>';
                            html_2 +='</div>';
                            html_2 +='</div>';
                            html_2 +='</div>';
                            html_2 +='</div>';
                        }

                    }
                        $('#html_1').html(html_1);
                        $('#html_2').html(html_2);
                }
            });
        }

        get_order_list();

        var ustd_price = '{:get_usdt()}';

        var Now_Price = 31405;
/**/
        function get_new_symbol_price(){
            $.ajax({
                type: 'get',
                url: '{:url("portal/index/get_new_symbol_price")}',
                success:function(res){
                    //console.log(res)
                    for(var key in res){
                        if(res[key].name == __symbol){
                            Now_Price = res[key].price;
                        }
                        if(res[key].zf < 0){
                            $('.'+res[key].name+'_price').html(parseFloat(res[key].price));
                            $('.'+res[key].name+'_zf').html(res[key].zf+'%');
                            $('.'+res[key].name+'_price').css("color","red");
                            $('.'+res[key].name+'_zf').css("color","red");
                        }else{
                            $('.'+res[key].name+'_price').html(parseFloat(res[key].price));
                            $('.'+res[key].name+'_zf').html('+'+res[key].zf+'%');
                            $('.'+res[key].name+'_price').css("color","green");
                            $('.'+res[key].name+'_zf').css("color","green");
                        }
                        $('.'+res[key].name+'_price_rmb').html('≈'+(res[key].price*ustd_price).toFixed(2)+' CNY');
                        $('.'+res[key].name+'_h').html(parseFloat(res[key].h));
                        $('.'+res[key].name+'_l').html(parseFloat(res[key].l));
                        $('.'+res[key].name+'_v').html(parseFloat(res[key].v));
                    }

                    $('.slide').each(function(index, el) {
                        let $thisspan = $(this).children('p').children('.slidetime');
                        let numtime = parseInt($thisspan.html().split('s')[0]);
                        let nowprice = Now_Price;
                        let buyprice = $(this).attr('data-price');
                        let direction = $(this).attr('data-direction');
                        if(direction == 1){
                            if(nowprice > buyprice){
                                $(this).find('.slidetype').html('{:lang("Profit")}')
                            }else{
                                $(this).find('.slidetype').html('{:lang("Loss")}')
                            }
                        }else{
                            if(nowprice < buyprice){
                                $(this).find('.slidetype').html('{:lang("Profit")}')
                            }else{
                                $(this).find('.slidetype').html('{:lang("Loss")}')
                            }
                        }
                        
                        if(numtime == 0){
                            $(this).remove();
                        }
                        numtime--;
                        $thisspan.html(numtime+'s');
                    });


                    $('.djs').each(function(index, el) {
                        let timenum = parseInt($(this).html());
                        if(timenum <= 0){
                            $(this).html(0)
                        }else{
                            timenum--;
                            $(this).html(timenum)
                        }
                        
                    });
                }

            });

            setTimeout('get_new_symbol_price()',_interval);
        }
        get_new_symbol_price();


        $('input[name=order_amount]').bind("input propertychange",function(event){
            var order_amount = $(this).val();
            var get_yield = '{:get_yield()}';
            $('#yj').html(order_amount*get_yield/100);
        });

        function check(val) {
            if (val < 10) {
                return ("0" + val);
            } 
            else {
                return (val);
            }
        }

        var now_time = '{:time()}';
        function displayTime() {
            now_time++;
            var timeDiv=document.getElementById("timeDiv");
            var date = new Date(now_time*1000);
            var year = date.getFullYear();
            var month = date.getMonth() + 1;
            var day = date.getDate();
            var hour = date.getHours();
            var minutes = date.getMinutes();
            var second = date.getSeconds();
            var timestr = year + "-" + check(month) + "-" + check(day) + "  " + check(hour)
                    + ":" + check(minutes) + ":" + check(second);
            timeDiv.innerHTML = timestr;
        }
        displayTime()
        window.setInterval("displayTime()",1000)

    </script>
    <script src="__STATIC__/hybit/js/Tdrag.min.js"></script>
    
</body>
</html>